package net.zoneland.knowledge.controller;

import net.zoneland.knowledge.constant.Constants;
import org.junit.Before;
import org.springframework.http.HttpHeaders;
import org.springframework.web.client.RestTemplate;

import java.time.*;
import java.time.format.DateTimeFormatter;

public class BaseRest {
    //本地地址
    protected static final String URL = "http://172.16.1.32:18080/smart-robot-api-web/";

    //移动生产环境
//    protected static final String URL = "http://dzbasesearch-oa.zj.chinamobile.com:8205/oadz-robot-search/";

    private RestTemplate restTemplate;

    static final String CONTENT_TYPE = "Content-Type";

    @Before
    public void setRestTemplate() {
        this.restTemplate = new RestTemplate();
    }

    public RestTemplate getRestTemplate() {
        return this.restTemplate;
    }

    protected HttpHeaders setHeaders() {
        HttpHeaders headers = new HttpHeaders();
        headers.set(Constants.APP_TOKEN, "eapGfNV4y2R8k6CgV/4g32+vGyjd+TIfzMbSPHyWXViL1lUXtOacgnuLDsJu4og0D4W4S/N27CXfg=");
        headers.set(CONTENT_TYPE, "application/json");
        return headers;
    }
}
